# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib import messages

from models import Pregao, ItemPregao, Item, Proposta


class ItemPregaoInline(admin.TabularInline):
    model = ItemPregao
    extra = 1

class PregaoAdmin(admin.ModelAdmin):
    model = Pregao
    inlines = (ItemPregaoInline,)
    list_display = ['__unicode__', 'is_ativo']

class PropostaAdmin(admin.ModelAdmin):
    model = Proposta
    list_display = ['__unicode__', 'valor','selecionada','item']
    list_filter = ['item__pregao', 'selecionada']

admin.site.register(Pregao, PregaoAdmin)
admin.site.register(ItemPregao)
admin.site.register(Item)
admin.site.register(Proposta, PropostaAdmin)
